package dfbz.demo;

public class Test02 {
    public static void main(String[] args) {
        int oddSum=getOdd(1,100);
        System.out.println(oddSum);
        int evenSum=getEven(1,100);
        System.out.println(evenSum);
    }
    public static int getOdd(int y,int z){
        int sum=0;
        for (int i = y; i <=z ; i++){
            if(i%2==0){
                sum+=i;
            }
        }
        return sum;
    }
    public static int getEven(int h,int j) {
        int sum1 = 0;
        for (int i = h; i <=j; i++) {
            if (i % 2 != 0) {
                sum1 += i;
            }
        }
        return sum1;
    }
}
